# final binary location
FINALBIN:=kernel.bin

# include the kernel data
-include mkinc/kernel.include

# buld the full kernel
all: $(FINALBIN)

# install
install: $(FINALBIN)
	cp $(FINALBIN) $(INSTALL_FOLDER)

# clean up - but only the kernel!
clean:
	rm $(shell find -iname "*.[oda]" | grep -Zv "./Userland/*")
	rm $(shell find -iname "*.bin" | grep -Zv "./Userland/*")

# link command
$(FINALBIN) : $(OBJS)
	$(LD) $(LDFLAGS) $(FINALBIN) $(OBJS)

# included files
-include $(DEPFILES)

# C++ source
%.o : %.cc
	$(CXX) $(CXXFLAGS) -MMD -MP -MT "$*.d" -c $< -o $@

# assembly
%.o : %.asm isr.inc irq.inc
	$(AS) $< -o $@
